let Fun = {
	isChrome: () => {
		return window.navigator.userAgent.indexOf("Chrome") !== -1;
	},
	nullValue: (val) => {
		if (!val || val == "null" || val == "undefined") {
			return "";
		}
		return val;
	},
	nullObject: (obj) => {
		for (var key in obj) {
			if (typeof key == "string") {
				var val = obj[key];
				obj[key] = this.nullValue(val);
			}
		}
		return obj;
	},
	isNum: (val) => {
		if (/^\d+$/.test(val) || /^\-[1-9][0-9]*$/.test(val)) {
			return true;
		}
		return false;
	},
	isMobile: (val) => {
		return /^1\d{10}$/.test(val);
	},
	isChinese: (str) => {
		var reg = /^[\u4E00-\u9FA5]+$/;
		if (!reg.test(str)) {
			return false;
		} else {
			return true;
		}
	},
	isNull: (o) => {
		if (o == null || o == undefined || o == "") {
			return true;
		}
		return false;
	}
};

export default Fun;
